package com.ssm.controller;

import com.ssm.entity.ManagerInfo;
import com.ssm.service.ManagerInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@RequestMapping(value = "managerInfo")
@Controller
@CrossOrigin
public class ManagerInfoController {

    @Autowired
    public ManagerInfoService managerInfoService;
    public void setManagerInfoService(ManagerInfoService managerInfoService) {
        this.managerInfoService = managerInfoService;
    }

    @ResponseBody
    @RequestMapping(value = "infos")
    //RequestParam
    public ManagerInfo managerInfoList(@RequestParam("address") String address){
        ManagerInfo managerInfo = this.managerInfoService.queryManagerInfo(address);
//        List<ManagerInfo> managerInfos = new ArrayList<ManagerInfo>();
//        managerInfos.add(managerInfo);
        return managerInfo;
    }
}
